from sqlalchemy import Integer, DECIMAL, String, DateTime, Column
from config.database import Base


class UnitInfo(Base):
    """
    填报单位信息表
    """

    __tablename__ = 'far_unit_info'

    id = Column(Integer, primary_key=True, autoincrement=True, nullable=False, comment='主键')
    guid = Column(String(255), nullable=True, comment='UUID')
    compname = Column(String(80), nullable=True, comment='单位名称')
    compid = Column(Integer, nullable=True, comment='单位ID')
    year = Column(String(4), nullable=True, comment='年度')
    yearupfile_guid = Column(String(255), nullable=True, comment='上年上传状态')
    yearnowfile_guid = Column(String(255), nullable=True, comment='本年上传状态')
    leader = Column(String(255), nullable=True, comment='科室')
    dept_id = Column(Integer, nullable=True, comment='部门ID')
    progress = Column(DECIMAL, nullable=True, comment='进度')
    status = Column(String(1), nullable=True, comment='审核状态')
    department = Column(String(255), nullable=True, comment='所属区县')
    remark = Column(String(255), nullable=True, comment='备注')
    sort = Column(Integer, nullable=True, comment='排序')
    create_time = Column(DateTime, nullable=True, comment='创建时间')
    update_time = Column(DateTime, nullable=True, comment='更新时间')
    pjxms = Column(String(255), nullable=True, comment='绩效项目个数')
    sjjz = Column(String(255), nullable=True, comment='绩效所用资金')
    main_type = Column(Integer, nullable=True, comment='单位类型: 0: 机关单位, 1: 事业单位')
    nine_table = Column(Integer, nullable=True, comment='九张表导入状态: 0: 未导入, 1:已导入')
    zpbg = Column(Integer, nullable=True, comment='自评报告是否上传，0：为上传，1：已上传')
    download_time = Column(DateTime, nullable=True, comment='最后一次下载报告时间')



